# @Time    :2025/3/30 21:53

"""
2）动态给实例 添加实例方法

"""
import types


class Person:
    def __init__(self, name=None):
        self.name = name


def eat(self):
    print(f"{self.name}在吃饭")


p1 = Person("SS")
p1.eat = types.MethodType(eat, p1)
p1.eat()
